package com.yyfax.pay.common.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 异步通知任务类型枚举
 * 
 * @author buyi
 * @date 2017-04-12 20:06:18
 * @since v1.0.0
 */
public enum NotifyTaskTypeEnum {
	PAY("1", "支付查询"),

	PAYOUT("2", "单笔代付查询"),

	PAYOUT_BATCH("3", "批量代付"),

	AUTHENTICATION("4", "鉴权"),

	PAYIN("5", "代扣"),

	PAYIN_BATCH("6", "批量代扣"),

	PAYOUT_REFUND("7", "单笔代付退票"),

	PROTOCOL_PAY("8", "协议支付");

	private String value;
	private String desc;

	private NotifyTaskTypeEnum(String value, String desc) {
		this.value = value;
		this.desc = desc;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public static final NotifyTaskTypeEnum fromValue(String value) {
		for (NotifyTaskTypeEnum e : NotifyTaskTypeEnum.values()) {
			if (StringUtils.equals(value, e.getValue())) {
				return e;
			}
		}
		return null;

	}


	public boolean isValue(String v) {
		return StringUtils.isBlank(v) ? false : this.value.equals(v);
	}
}
